package com.situ.service;

import com.situ.bean.PageResult;
import com.situ.bean.Product;
import com.situ.dao.ProductDao;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@Mapper
public interface IProductService {
    List<Product> getAllProducts();
    Product  getProductById(@RequestParam int id);

    int getTotalProducts();

    PageResult<Product> getProducts(int page, int pageSize);
    List<Product> searchProducts(@Param("query") String query);



    List<Product> filterProducts(
            @Param("categories") List<Integer> categories,
            @Param("minPrice") Double minPrice,
            @Param("maxPrice") Double maxPrice);



    List<Integer> findCategoryIdsByPids( @Param("categoryIds")   List<Integer>  categoryIds);
    List<Product>  getAllofProducts();
}
